.class public final Lnbisdk/bu;
.super Ljava/lang/Object;

# interfaces
.implements Lnbisdk/kg;


# annotations
.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Lnbisdk/bu$a;
    }
.end annotation


# instance fields
.field private out:Ljava/io/OutputStream;

.field private qJ:Lnbisdk/sl;

.field private qX:I

.field private qY:I


# direct methods
.method public constructor <init>(Lnbisdk/sl;)V
    .locals 0
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/io/IOException;,
            Ljava/lang/SecurityException;
        }
    .end annotation

    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    iput-object p1, p0, Lnbisdk/bu;->qJ:Lnbisdk/sl;

    return-void
.end method

.method static synthetic a(Lnbisdk/bu;)I
    .locals 2

    iget v0, p0, Lnbisdk/bu;->qY:I

    add-int/lit8 v1, v0, 0x1

    iput v1, p0, Lnbisdk/bu;->qY:I

    return v0
.end method

.method static synthetic a(Lnbisdk/bu;I)I
    .locals 1

    iget v0, p0, Lnbisdk/bu;->qY:I

    add-int/2addr v0, p1

    iput v0, p0, Lnbisdk/bu;->qY:I

    return v0
.end method

.method static synthetic b(Lnbisdk/bu;)I
    .locals 1

    iget v0, p0, Lnbisdk/bu;->qY:I

    return v0
.end method

.method static synthetic c(Lnbisdk/bu;)I
    .locals 1

    iget v0, p0, Lnbisdk/bu;->qX:I

    return v0
.end method


# virtual methods
.method public final close()V
    .locals 1
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/io/IOException;
        }
    .end annotation

    iget-object v0, p0, Lnbisdk/bu;->out:Ljava/io/OutputStream;

    if-eqz v0, :cond_0

    iget-object v0, p0, Lnbisdk/bu;->out:Ljava/io/OutputStream;

    invoke-virtual {v0}, Ljava/io/OutputStream;->close()V

    :cond_0
    return-void
.end method

.method public final w()Ljava/io/OutputStream;
    .locals 1
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/io/IOException;
        }
    .end annotation

    new-instance v0, Ljava/io/ByteArrayOutputStream;

    invoke-direct {v0}, Ljava/io/ByteArrayOutputStream;-><init>()V

    iput-object v0, p0, Lnbisdk/bu;->out:Ljava/io/OutputStream;

    iget-object v0, p0, Lnbisdk/bu;->out:Ljava/io/OutputStream;

    return-object v0
.end method

.method public final x()Ljava/io/InputStream;
    .locals 5
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/io/IOException;
        }
    .end annotation

    new-instance v1, Ljava/net/URL;

    iget-object v2, p0, Lnbisdk/bu;->qJ:Lnbisdk/sl;

    invoke-interface {v2}, Lnbisdk/sl;->getHostName()Ljava/lang/String;

    move-result-object v2

    invoke-direct {v1, v2}, Ljava/net/URL;-><init>(Ljava/lang/String;)V

    invoke-virtual {v1}, Ljava/net/URL;->openConnection()Ljava/net/URLConnection;

    move-result-object v1

    invoke-virtual {v1}, Ljava/net/URLConnection;->getContentLength()I

    move-result v2

    iput v2, p0, Lnbisdk/bu;->qX:I

    const/4 v2, 0x0

    iput v2, p0, Lnbisdk/bu;->qY:I

    new-instance v2, Ljava/io/BufferedInputStream;

    new-instance v3, Lnbisdk/bu$a;

    invoke-virtual {v1}, Ljava/net/URLConnection;->getInputStream()Ljava/io/InputStream;

    move-result-object v4

    invoke-direct {v3, p0, v4}, Lnbisdk/bu$a;-><init>(Lnbisdk/bu;Ljava/io/InputStream;)V

    const/16 v4, 0x2000

    invoke-direct {v2, v3, v4}, Ljava/io/BufferedInputStream;-><init>(Ljava/io/InputStream;I)V

    iget v3, p0, Lnbisdk/bu;->qX:I

    if-nez v3, :cond_0

    const-string v3, "HttpSimpleConnection"

    invoke-virtual {v1}, Ljava/net/URLConnection;->toString()Ljava/lang/String;

    move-result-object v4

    invoke-static {v3, v4}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I

    instance-of v3, v1, Ljava/net/HttpURLConnection;

    if-eqz v3, :cond_0

    move-object v0, v1

    check-cast v0, Ljava/net/HttpURLConnection;

    move-object p0, v0

    invoke-virtual {p0}, Ljava/net/HttpURLConnection;->getResponseCode()I

    move-result v1

    const/16 v3, 0xc8

    if-eq v1, v3, :cond_0

    invoke-virtual {p0}, Ljava/net/HttpURLConnection;->getResponseMessage()Ljava/lang/String;

    move-result-object v1

    new-instance v2, Ljava/io/IOException;

    new-instance v3, Ljava/lang/StringBuilder;

    invoke-direct {v3}, Ljava/lang/StringBuilder;-><init>()V

    invoke-virtual {v3, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    const-string v3, " "

    invoke-virtual {v1, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {p0}, Ljava/net/HttpURLConnection;->getResponseCode()I

    move-result v3

    invoke-virtual {v1, v3}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v1

    invoke-direct {v2, v1}, Ljava/io/IOException;-><init>(Ljava/lang/String;)V

    throw v2

    :cond_0
    return-object v2
.end method
